package com.guiguli.FileDemo;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class InputStreamDemo1 {
    public static void main(String[] args) throws IOException {
        InputStream is = new FileInputStream("D:\\ideaProject\\day03-code\\src\\com\\guiguli\\FileDemo\\1.txt");
        byte[] bytes = new byte[1024];
        is.read(bytes);//读取文件数据
        System.out.println(new String(bytes,"UTF-8"));//将二进制的数据转换为UTF-8的字符串
        is.close();
    }
}
